@import url(https://fonts.googleapis.com/css?family=Open+Sans:300,400);

$drop-color: #7FC1F9;

html,body{
    margin: 0;
    height: 100%;
}

body{
    display: flex;
    justify-content: center;
    align-items: center;
}

.frame {
    position: relative;
    width: 400px;
    height: 400px;
    background-color: #1A2238;
    border-radius: 2px;
    box-shadow: 1px 2px 10px rgba(0,0,0,0.3);
    color: #394568;
    font-family: 'Open Sans', Helvetica, sans-serif;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

.moon{
    position: absolute;
    top: 45px;
    left: 55px;
    width: 67px;
    height: 67px;
    border-radius: 50%;
    background-color: #F6EDBD;
    overflow: hidden;
    box-shadow: 0 0 10px 0 #F6EDBD;

    animation: rise 1.2s ease-out;

    .crater-1{
        position: absolute;
        width: 11px;
        height: 11px;
        border-radius: 50%;
        background-color: #ECE1A8;
        top: 4px;
        left: 8px;
    }

    .crater-2{
        @extend .crater-1;
        top:50px;
        left: 50px;
    }

    .crater-3{
        @extend .crater-1;
        top: 9px;
        left: 28px;
    }

    .crater-4{
        @extend .crater-1;
        width: 7px;
        height: 7px;
        top: 50px;
        left: 40px;
    }

    .crater-5{
        @extend .crater-4;
        top:30px;
        left: -2px;
    }

    .crater-6{
        @extend .crater-4;
        left: 50px;
        top: 20px;
    }

    .crater-7{
        @extend .crater-4;
        width: 4px;
        height: 4px;
        left: 21px;
        top :24px;
    }

    .crater-8{
        @extend .crater-7;
        left: 14px;
        top: 47px;
    }

    .crater-9{
        @extend .crater-7;
        top: 37px;
        left: 37px;
    }

    .crater-10{
        @extend .crater-4;
        left: 33px;
        top: 26px;
    }

    .crater-11{
        @extend .crater-4;
        top: 36px;
        left: 14px;
    }
}

.hill-bg-1{
    position: absolute;
    z-index: 2;
    width: 337px;
    height: 281px;
    top: 201px;
    left: -51px;
    border-radius: 50%;
    background-color: #26314F;
}

.hill-bg-2{
    @extend .hill-bg-1;
    top: 197px;
    left: 177px;
}

.hill-fg-1{
    @extend .hill-bg-1;
    background-color: #303C5D;
    top: 248px;
    left: -137px;
}

.hill-fg-2{
    @extend .hill-fg-1;
    top: 221px;
    left: 63px;
}

.hill-fg-3{
    @extend .hill-fg-1;
    top: 248px;
    left: 292px;
}

.front{
    position: absolute;
    width: 400px;
    height: 90px;
    z-index: 10;
    background-color: #fff;
    bottom: 0;
    left: 0;

    .temperature{
        float: left;
        margin-left: 20px;
        font-size: 45px;
        line-height: 90px;
    }

    .info{
        float: left;
        margin: 25px 0 0 23px;
        line-height: 20px;
        font-size: 15px;
    }

    .preview{
        float: right;
        text-align: right;
        margin: 25px 20px 0 0;
        font-size: 15px;
        line-height: 20px;
        font-weight: 400;

        td{
            text-transform: uppercase;
            padding: 0 3px;
            &:first-child{
                font-weight: 300;
            }
        }
    }
}

@for $i from 1 through 10{
    .drop-big-#{$i}{
        position: absolute;
        z-index: 20;
        background-color: $drop-color;
        width: 8px;
        height: 8px;
        bottom: 90px;
        border-radius: 50%;
        left: (-20 + $i*38) + px;
        transform-origin: 50% 100%;
        animation: drop (0.7 + random(2)/10)+s linear (random(50)/25)+s infinite;

        &::before{
            position: absolute;
            content: "";
            display: block;
            top: -2px;
            left: 1px;
            height: 6px;
            width: 6px;
            background-color: $drop-color;
            border-radius: 3px;
        }

        &::after{
            position: absolute;
            content: "";
            display: block;
            width: 4px;
            height: 10px;
            top: -5px;
            left: 2px;
            background-color: $drop-color;
            border-radius: 50%;
        }
    }

    .drop-medium-#{$i}{
        @extend .drop-big-1;
        left: (-20 + $i*38) + px;
        opacity: 0.6;
        width: 6px;
        height: 6px;
        animation: drop (1.3 + random(2)/10)+s linear (random(50)/25)+s infinite;


        &::before{
            top: -2px;
            left: 1px;
            width: 4px;
            height: 4px;
        }

        &::after{
            left: 2px;
            top: -4px;
            width: 2px;
            height: 6px;
        }
    }

    .drop-small-#{$i}{
        @extend .drop-big-1;
        left: (-20 + $i*38) + px;
        opacity: 0.3;
        width: 4px;
        height: 4px;
        animation: drop (1.9 + random(2)/10)+s linear (random(50)/25)+s infinite;

        &::before{
            top: -2px;
            left: 1px;
            width: 2px;
            height: 2px;
        }

        &::after{
            top: -3px;
            left: 1px;
            width: 2px;
            height: 4px;
        }
    }
}

@keyframes drop {
    0%{
        transform: translate3d(40px, -320px, 0) scaleX(1) scaleY(1) rotate(20deg);
    }   
    85% {
        transform: translate3d(0,0,0) scaleX(1) scaleY(1) rotate(20deg);
    } 
    100% {
        transform:  translate3d(0,0,0) scaleX(3) scaleY(0) rotate(0deg);
    }
}

@keyframes rise {
    from{
        transform: translate(-20px, 220px);
    }
    to{
        transform: translate(0, 0px);
    }
}